package Test;

import java.util.ArrayList;
//测试类：Main验证继承关系、访问控制与业务逻辑

import base.*;



public class Main {
    public static void main(String[] args) {
        // 创建教师与课程
        Teacher teacher1 = new Teacher("T001", "王教授", "女", "教授", new ArrayList<>());
        Teacher teacher2 = new Teacher("T002", "吴老师", "女", "老师", new ArrayList<>());
        Course course1 = new Course("C001", "Java编程", "计算机楼101", "周一 10:00-12:00", 3, teacher1);
        Course course2 = new Course("C002", "数据结构", "计算机楼102", "周三 14:00-16:00", 4, teacher2);
        teacher1.addCourse(course1);
        teacher2.addCourse(course2);

        // 教师开课
        teacher1.openCourses();
        teacher2.openCourses();
        // 创建学生并选课
        Student student1 = new Student("S001", "张三", "男", "大数据");
        student1.selectCourse(course1);
        student1.selectCourse(course2);
        
        Student student2 = new Student("S002", "李四", "女", "大数据");
        student2.selectCourse(course1);
        student2.selectCourse(course2);
        
        // 打印课表
        student1.printCourseSchedule();
        student2.printCourseSchedule();
        
        // 退课测试
        student1.dropCourse(course1);
        student1.printCourseSchedule();

        // 验证继承关系
        System.out.println("===== 继承关系验证 =====");
        System.out.println("student1 是 Person 吗？ " + (student1 instanceof Person));
        System.out.println("teacher1 是 Person 吗？ " + (teacher1 instanceof Person));
        System.out.println("teacher2 是 Person 吗？ " + (teacher2 instanceof Person));
        System.out.println("student2 是 Person 吗？ " + (student2 instanceof Person));
    }
}
